package com.chenjj.java.jdk8.lambda;

import java.util.Comparator;

public class Person {
    public String firstName;

    public String lastName;

    public int age;

    //lambda作为类静态变量
    public final static Comparator<Person> compareFirstName =  (lhs, rhs) ->{return lhs.firstName.compareTo(rhs.firstName);};

    public Person(String firstName, String lastName, int age) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.age = age;
    }

    public String toString() {
        return firstName + "," + lastName + "," + age;
    }

    public String getFullName(){
       return firstName + " " + lastName;
    }

    public String getFirstName(){
        return firstName;
    }

    public int getAge(){
        return age;
    }
}
